//
//  BlankView.m
//  KBLove
//
//  Created by WDL on 15/12/24.
//  Copyright © 2015年 block. All rights reserved.
//

#import "BlankView.h"

@implementation BlankView



+(UIView *)imagename:(NSString *)name titleStr:(NSString *)title
{
    
    UIImage *imageview = [UIImage imageNamed:name];
    
    UIView *blank = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height)];
    blank.backgroundColor = BackgroundColor;
    
    UIImageView *blankimg = [[UIImageView alloc]initWithFrame:CGRectMake((Screen_Width - imageview.size.width)/2, (Screen_Height - imageview.size.height)/3*1, imageview.size.width,imageview.size.height)];
    blankimg.image = [UIImage imageNamed:name];
    [blank addSubview:blankimg];
    
    
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(blankimg.frame)+10, Screen_Width - 20*2, 20)];
    titleLabel.text = title;
    titleLabel.textColor = UIColorFromRGB(0x323232);
    titleLabel.font = [UIFont systemFontOfSize:13];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [blank addSubview:titleLabel];
    
    return blank;
}

+(UIView *)imagename:(NSString *)name
{
    
    UIImage *imageview = [UIImage imageNamed:name];
    
    UIView *blank = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height)];
    blank.backgroundColor = BackgroundColor;
    
    UIImageView *blankimg = [[UIImageView alloc]initWithFrame:CGRectMake((Screen_Width - imageview.size.width)/2, (Screen_Height - imageview.size.height)/2*1-40, imageview.size.width,imageview.size.height)];
    blankimg.image = [UIImage imageNamed:name];
    [blank addSubview:blankimg];
    return blank;
}

+(UIView *)rightimagename:(NSString *)name
{
    
    UIImage *imageview = [UIImage imageNamed:name];
    
    UIView *blank = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height)];
    blank.backgroundColor = BackgroundColor;
    
    UIImageView *blankimg = [[UIImageView alloc]initWithFrame:CGRectMake((Screen_Width - imageview.size.width)/2 - 45, (Screen_Height - imageview.size.height)/2*1-80, imageview.size.width,imageview.size.height)];
    blankimg.image = [UIImage imageNamed:name];
    [blank addSubview:blankimg];
    return blank;
}








+(UIView *)loadDatatitleStrheighy:(float)heighty
{
    
    UIView *blank = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height)];
    blank.backgroundColor = BackgroundColor;
    
    UIImage *image = [UIImage imageNamed:@"dropdown_anim__0001"];
    
    UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake((Screen_Width - image.size.width)/2, (Screen_Height - image.size.height)/4*2+heighty, image.size.width, image.size.height)];
        NSMutableArray  *arrayM=[NSMutableArray array];
    for (int i=1; i<=6; i++) {
        [arrayM addObject:[UIImage imageNamed:[NSString stringWithFormat:@"dropdown_anim__000%zd",i]]];
    }
    //设置动画数组
    [imageview setAnimationImages:arrayM];
    //设置动画播放次数
    [imageview setAnimationRepeatCount:0];
    //设置动画播放时间
    [imageview setAnimationDuration:7*0.1];
    //开始动画
    [imageview startAnimating];
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(imageview.frame)+20, Screen_Width - 20*2, 20)];
    titleLabel.text = @"正在努力加载中";
    titleLabel.textColor = GrayColor;
    titleLabel.textAlignment = NSTextAlignmentCenter;
//    [blank addSubview:titleLabel];
    [blank addSubview:imageview];
    
    return blank;
    
    
}
@end
